<template>
	<view class="container">
		<view class="rows f-c-between" @click="goPage('/pages/mine/editPhone')">
			<view class="label">修改手机号</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>
		<view class="rows f-c-between" @click="goPage('/pages/mine/editPwd')">
			<view class="label">修改登录密码</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>
		<view class="rows f-c-between" @click="goPage('/pages/webview/index?type=yhxy&title=用户协议')">
			<view class="label">用户协议</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>
		<view class="rows f-c-between" @click="goPage('/pages/webview/index?type=yszc&title=隐私政策')">
			<view class="label">隐私政策</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>
		<view class="rows f-c-between" @click="goPage('/pages/webview/index?type=gywm&title=关于我们')">
			<view class="label">关于我们</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>
		<!-- #ifdef APP -->
		<view class="rows f-c-between" @click="onCheckVersionClick">
			<view class="label">检查新版本</view>
			<view class="right f-a-center">
				<span style="margin-right: 12rpx;">v{{systemInfo.appVersion}}</span>
				<u-icon name="arrow-right" size="28rpx" color="#CDD1D3" top="2rpx"></u-icon>
			</view>
		</view>
		<!-- #endif -->
		
		<view class="rows f-c-between" @click="goPage('/pages/mine/logOff')">
			<view class="label">注销账号</view>
			<u-icon name="arrow-right" size="28rpx" color="#CDD1D3"></u-icon>
		</view>

		<button class="btn-exit" @click="quitLogin">退出登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {},
		methods: {
			// 退出登录
			quitLogin() {
				uni.showModal({
					content: "是否退出该账号？",
					confirmColor: '#FFC046',
					success: (res) => {
						if (res.confirm) {
							this.$store.dispatch('do_logout')
							this.$store.commit('SET_allCartList', [])
							uni.reLaunch({
								url: '/pages/login/login'
							})
						}
					}
				})
			},
			goPage(url) {
				uni.navigateTo({
					url
				})
			},
			onCheckVersionClick() {
				this.$api.get_versionInfo().then(res => {
					this.$util.appUpdataUtil.doUpdate({
						localVersion: this.systemInfo.appVersion,
						netVersion: res?.VERSION,
						update_link: res?.update_link
					})
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #F4F7F7;
	}
</style>
<style lang="scss" scoped>
	.container {
		padding: 16rpx;
	}

	.rows {
		width: 100%;
		height: 96rpx;
		background: #FFFFFF;
		border-radius: 14rpx;
		padding: 0 28rpx;
		margin-top: 20rpx;
		font-weight: 400;
		font-size: 32rpx;
		color: #51565D;
	}

	.btn-exit {
		width: 91%;
		height: 74rpx;
		line-height: 74rpx;
		background: #FFC046;
		border-radius: 38rpx;
		margin: 46rpx auto 0;
		font-weight: 400;
		font-size: 32rpx;
		color: #FFFFFF;
	}
</style>